In a mobile network with rapidly changing traffic patterns, traditional hardware solutions are often unable to effectively deal with a worst case traffic pattern. If the hardware required for the worst case is significantly large it results in operators buying a large number of servers which are not used effectively most of the time. If the number of servers are small, the optimization solution can get overloaded (e.g., in terms of CPU and memory) when there is a sudden spike in optimizable heavy content (e.g., images and video).